home *** CD-ROM | disk | FTP | other *** search
/ LG Super CD / LG Super CD.iso / bitpim / bitpim-0.62-setup.exe / {app} / bitpim.exe / string.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2003-11-06  |  6.5 KB  |  160 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.3)
  3.  
  4. whitespace = ' \t\n\r\x0b\x0c'
  5. lowercase = 'abcdefghijklmnopqrstuvwxyz'
  6. uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  7. letters = lowercase + uppercase
  8. ascii_lowercase = lowercase
  9. ascii_uppercase = uppercase
  10. ascii_letters = ascii_lowercase + ascii_uppercase
  11. digits = '0123456789'
  12. hexdigits = digits + 'abcdef' + 'ABCDEF'
  13. octdigits = '01234567'
  14. punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
  15. printable = digits + letters + punctuation + whitespace
  16. l = map(chr, xrange(256))
  17. _idmap = str('').join(l)
  18. del l
  19. index_error = ValueError
  20. atoi_error = ValueError
  21. atof_error = ValueError
  22. atol_error = ValueError
  23.  
  24. def lower(s):
  25.     return s.lower()
  26.  
  27.  
  28. def upper(s):
  29.     return s.upper()
  30.  
  31.  
  32. def swapcase(s):
  33.     return s.swapcase()
  34.  
  35.  
  36. def strip(s, chars = None):
  37.     return s.strip(chars)
  38.  
  39.  
  40. def lstrip(s, chars = None):
  41.     return s.lstrip(chars)
  42.  
  43.  
  44. def rstrip(s, chars = None):
  45.     return s.rstrip(chars)
  46.  
  47.  
  48. def split(s, sep = None, maxsplit = -1):
  49.     return s.split(sep, maxsplit)
  50.  
  51. splitfields = split
  52.  
  53. def join(words, sep = ' '):
  54.     return sep.join(words)
  55.  
  56. joinfields = join
  57.  
  58. def index(s, *args):
  59.     return s.index(*args)
  60.  
  61.  
  62. def rindex(s, *args):
  63.     return s.rindex(*args)
  64.  
  65.  
  66. def count(s, *args):
  67.     return s.count(*args)
  68.  
  69.  
  70. def find(s, *args):
  71.     return s.find(*args)
  72.  
  73.  
  74. def rfind(s, *args):
  75.     return s.rfind(*args)
  76.  
  77. _float = float
  78. _int = int
  79. _long = long
  80.  
  81. def atof(s):
  82.     return _float(s)
  83.  
  84.  
  85. def atoi(s, base = 10):
  86.     return _int(s, base)
  87.  
  88.  
  89. def atol(s, base = 10):
  90.     return _long(s, base)
  91.  
  92.  
  93. def ljust(s, width):
  94.     return s.ljust(width)
  95.  
  96.  
  97. def rjust(s, width):
  98.     return s.rjust(width)
  99.  
  100.  
  101. def center(s, width):
  102.     return s.center(width)
  103.  
  104.  
  105. def zfill(x, width):
  106.     if not isinstance(x, basestring):
  107.         x = repr(x)
  108.     
  109.     return x.zfill(width)
  110.  
  111.  
  112. def expandtabs(s, tabsize = 8):
  113.     return s.expandtabs(tabsize)
  114.  
  115.  
  116. def translate(s, table, deletions = ''):
  117.     if deletions:
  118.         return s.translate(table, deletions)
  119.     else:
  120.         return s.translate(table + s[:0])
  121.  
  122.  
  123. def capitalize(s):
  124.     return s.capitalize()
  125.  
  126.  
  127. def capwords(s, sep = None):
  128.     if not sep:
  129.         pass
  130.     return join(map(capitalize, s.split(sep)), ' ')
  131.  
  132. _idmapL = None
  133.  
  134. def maketrans(fromstr, tostr):
  135.     global _idmapL
  136.     if len(fromstr) != len(tostr):
  137.         raise ValueError, 'maketrans arguments must have same length'
  138.     
  139.     if not _idmapL:
  140.         _idmapL = map(None, _idmap)
  141.     
  142.     L = _idmapL[:]
  143.     fromstr = map(ord, fromstr)
  144.     for i in range(len(fromstr)):
  145.         L[fromstr[i]] = tostr[i]
  146.     
  147.     return join(L, '')
  148.  
  149.  
  150. def replace(s, old, new, maxsplit = -1):
  151.     return s.replace(old, new, maxsplit)
  152.  
  153.  
  154. try:
  155.     from strop import maketrans, lowercase, uppercase, whitespace
  156.     letters = lowercase + uppercase
  157. except ImportError:
  158.     pass
  159.  
  160.